<template>
    <div class="content_panel project_modules">
        <div class="content_panel_top">
            <h3 class="panel_title">
                <span>{{$t('pageTitle.exportFail')}}</span>
            </h3>
        </div><!--content_panel_top-->
        <div class="module_content">
            <div class="content_panel project_modules">
                <div class="table_list">
                    <el-table ref="table" :data="tableData" style="width: 100%;" :max-height="tableMaxHeight" :highlight-current-row="true">
                        <el-table-column prop="fileName" :label="$t('salesManage.fileName')" min-width="180"></el-table-column><!--文件名-->
                        <el-table-column prop="fileTag" :label="$t('common.downSource')" min-width="160"></el-table-column><!--下载源-->
                        <el-table-column align="left" :label="$t('common.downTime')" min-width="170" prop="successTime"><!--实际还款时间-->
                            <template slot-scope="{ row }">{{ row.successTime | formatDate('yyyy-MM-dd hh:mm:ss') }}</template>
                        </el-table-column>
                        <el-table-column :label="$t('common.operation')" min-width="160">
                            <template slot-scope="{row}">
                                <a :href="row.filePath">{{ $t('common.download') }}</a><!--下载--> 
                            </template>
                        </el-table-column>
                    </el-table>
                    <!--分页组件-->
                    <pagination @pageChange="pageChange" :page="page"><!--分页组件--></pagination>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import Pagination from '@/components/pagination';
    import mixin from '@/service/mixin';
    import SelectAppList from '@/components/select-app-list';
    import SelectAccountList from '@/components/select-account-list';

    let that = null;
    export default {
        name: 'export-fail-list',
        components: {
            Pagination,
            SelectAppList,
            SelectAccountList
        },
        mixins: [mixin],
        data() {
            return {
                tableData: [],
                totalRepayAmount:0,
                phaseData: [],
                // page: {
                    // pageNo: 1,
                    // pageSize: 20
                // },
                selectDataType: {
                    systemType: 'recruiter',
                    roleCode: 127
                }
            };
        },
        methods: {
            // 获取列表数据
            getTableData(page = this.page) {
                const params = this.fillParams(page);
                console.warn(params)
                this.$api.collection.getHandlingOverdueInfoFile(params).then(res => {
                    const {status, data, error} = res;
                    if ('1' === status && '00000000' === error && data) {
                        this.tableData = data.resultData;
                        this.setPage(data.page, this.page);
                        this.totalRepayAmount = data.totalRepayAmount
                    }
                    this.tableMaxHeight = document.body.clientHeight - 270;
                });
            },
            // 配置查询和导出参数
            fillParams(page = this.page) {
                console.warn(page)
                const params = {
                    page: {
                        pageNo: page.currentPage,
                        pageSize: this.page.pageSize
                    }
                };
                return params
            },
        },
        created() {
            that = this;
            this.getTableData();
        }
    }
</script>
<style lang="scss" scoped>
    [data-page=collection-orderManage-repayRecord] {
        .el-col {
            padding-left: 10px;
        }
        .el-table .cell, .el-table th > .cell {
            word-break: keep-all;
            word-wrap: break-word;
        }
    }
</style>

